In order to secure data, it is common to encrypt the data and store it in a database. Such encryption is typically based on an encryption algorithm that utilizes an encryption key. Since encryption keys may be discovered, a common security policy requires periodic re-encryption of the data using a new encryption key so that a one-time discovery of an encryption key does not lead to life-time access to the data. In order to perform such a re-encryption, the stored encrypted values must be read from the database, decrypted using the old encryption key, re-encrypted using the new encryption key and re-written to the database. For very large data sets, this process can be extremely time consuming and require a large amount of computing resources.
International Business Machines (IBM) provides a database program known as DB2. This program includes a utility, known as the UNLOAD utility, for reading data from a database into a dataset or file and a utility, known as the LOAD utility, for writing data from a dataset or file to a database. In addition, DB2 provides a mechanism for unloading separate partitions of a table into separate datasets using a TEMPLATE utility in combination with the UNLOAD utility. The TEMPLATE utility instruction designates a filename template that includes a variable for the partition number. The UNLOAD utility instruction designates a range of partition values that are to be unloaded and includes a reference to the template utility instruction. During execution of the UNLOAD utility, the reference to the TEMPLATE utility causes the filename template of the TEMPLATE utility to be retrieved. For each partition in the partition range, the partition variable is replaced with the partition value to form a filename. A file with the resulting filename is then created and the data for the partitions is unloaded into the respective files.
The TEMPLATE utility can also be used with the LOAD utility. When used with the LOAD utility, the TEMPLATE utility instruction designates a filename template that includes a variable for the partition number. A separate portion of the LOAD utility instruction is then provided for each partition. Each portion of the LOAD utility instruction includes a reference to the TEMPLATE utility and a partition number. When a LOAD utility instruction is executed, the references to the TEMPLATE utility instruction are used to retrieve the filename template and to replace the partition variable in the filename template with the partition number of that portion of the LOAD utility instruction. The resulting filenames are then used as the input files from which data is loaded into the partitions of the table.
As part of the UNLOAD utility, a PUNCH file is created that includes LOAD utility instructions for reloading the data that is unloaded into the datasets back into the partitions of the table. Many of the parameters in the LOAD utility instructions of the PUNCH file are controlled by the UNLOAD utility internally and cannot be designated when executing the UNLOAD utility instruction.
The discussion above is merely provided for general background information and is not intended to be used as an aid in determining the scope of the claimed subject matter.